package com.situ.b2c.address.controller;

import java.io.IOException;
import javax.servlet.ServletException;
import javax.servlet.annotation.WebServlet;
import javax.servlet.http.HttpServlet;
import javax.servlet.http.HttpServletRequest;
import javax.servlet.http.HttpServletResponse;

import com.situ.b2c.address.service.AddrService;
import com.situ.b2c.pojo.Address;
import com.situ.b2c.pojo.User;

/**
 * Servlet implementation class AddressGoUpdateServlet
 */
@WebServlet("/AddressGoUpdateServlet")
public class AddressGoUpdateServlet extends HttpServlet {
	private static final long serialVersionUID = 1L;
    
    
	protected void doGet(HttpServletRequest request, HttpServletResponse response) throws ServletException, IOException {
		Long rowId = Long.parseLong(request.getParameter("rowId"));
		System.out.println(rowId);
		
		Address address = new AddrService().selectOneById(rowId);
		
		request.setAttribute("address", address);
		request.getRequestDispatcher("address_edit.jsp").forward(request, response);
		
	}

	
	protected void doPost(HttpServletRequest request, HttpServletResponse response) throws ServletException, IOException {
		
		doGet(request, response);
	}

}
